-- local val =3
-- while (val>1)
-- do
--     print(val)
--     local function PRINT_VAL_AND_1(val)
--         return val+1
--     end
--     print(PRINT_VAL_AND_1)
--     val=val-1
-- end
-- print(PRINT_VAL_AND_1)



-- --variableParameters
-- local function averageValue(...)
--     local reslut=0
--     local arg={...}
--     for i,v in ipairs(arg)
--     do
--         print(v)
--         reslut=reslut+v
--     end
--     print("pass in total of "..#arg.." parameters")
--     return reslut/#arg
-- end
-- print("average of 1,2,3",averageValue(1,2,3))



--select
function f(...)
    a=select(3,...)
    print(a)
    print(select(3,...))
end

f(1,2,3,4,5)